import React, { Component } from 'react';
import {glabalContext} from "./common/js/globalData"
const {Consumer} =glabalContext
class Child2_b extends Component{
    render(){
        return(
            <div>
                <h1>子组件child2:(我和child1是兄弟)</h1>
                {/* 也读取父组件的role数据 */}
                <Consumer>
                    {
                        value=>(
                            <div>
                                {value.role}
                            </div>
                        )
                    }
                </Consumer>
            </div>
        )
    }
}
export default Child2_b